package com.example.bootdemo.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
public class LayData {
    /**
     * 状态码   code 0
     */
    private Integer code = 0;
    /**
     * 信息
     */
    private String msg = "";
    /**
     * 代表的是数据的总条数
     * 为了分页的时候使用的
     */
    private Integer count = 10;
    /**
     * table表格里面需要的数据
     */
    private Object data;

    public LayData(Integer count, List<?> data) {
        this.code = 0;
        this.msg = "";
        this.count = count;
        this.data = data;
    }

    public LayData(Object data) {
        this.code = 0;
        this.msg = "";
        this.data = data;
    }

    @Override
    public String toString() {
        return "LayData{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", count=" + count +
                ", data=" + data +
                '}';
    }
}
